package com.zhenhao.xsq.ui.activity.door;

import android.os.Bundle;
import android.view.View;

import com.zhenhao.xsq.R;
import com.zhenhao.xsq.application.AppConfig;
import com.zhenhao.xsq.base.BaseActivity;
import com.zhenhao.xsq.ui.activity.door.component.DaggerInviteComponent;
import com.zhenhao.xsq.ui.activity.door.contract.InviteContract;
import com.zhenhao.xsq.ui.activity.door.module.InviteModule;
import com.zhenhao.xsq.ui.activity.door.presenter.InvitePresenter;
import com.zhenhao.xsq.ui.activity.login.component.DaggerRegisterComponent;
import com.zhenhao.xsq.ui.activity.login.module.RegisterModule;
import com.zhenhao.xsq.utils.ToastUtil;

import javax.inject.Inject;

import androidx.core.content.ContextCompat;
import butterknife.ButterKnife;

public class InviteActivity extends BaseActivity implements InviteContract.View {

    @Inject
    InvitePresenter mPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void initView() {
        setContentView(R.layout.activity_invite);
        ButterKnife.bind(this);
        //        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        setToolbarTitle("访客邀请");

        autolayout.setBackgroundColor(ContextCompat.getColor(this, R.color.color_00000000));
        mToolbar.setBackgroundColor(ContextCompat.getColor(this, R.color.color_00000000));
        rootLayout.setBackground(ContextCompat.getDrawable(this, R.mipmap.bg_activity_base));
        toolbarTitle.setTextColor(ContextCompat.getColor(this, R.color.black));
        toolbarMenu.setTextColor(ContextCompat.getColor(this, R.color.color_333333));
        mToolbar.setNavigationIcon(ContextCompat.getDrawable(this, R.mipmap.toolbar_back2));

        setMenuText("邀请记录", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ToastUtil.showLong("邀请记录");
            }
        });
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void setupActivityComponent() {
        DaggerInviteComponent
                .builder()
                .appComponent(((AppConfig) getApplication()).getApplicationComponent())
                .inviteModule(new InviteModule(this))
                .build()
                .inject(this);
    }

    @Override
    public void showProgressDialog() {
        progressDialog.show();
    }

    @Override
    public void closeProgressDialog() {
        progressDialog.hide();
    }

    @Override
    public void setPresenter(InviteContract.InviteContractPresenter presenter) {
        mPresenter = (InvitePresenter) presenter;
    }
}
